package com.yeheng.Myannotion;

import com.yeheng.myvalidator.MyValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @PackgeName: com.yeheng.Myannotion 
 * @ClassName: MyParam
 * @Author: YH
 * Date: 2020/12/30 16:50
 * project name: springmvc_Validation 
 * @Version:
 * @Description:
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {MyValidator.class})
public @interface MyParam {
    // 验证失败的错误提示信息
    String message() default "需要一个质数";

    // 用于分组的属性
    Class<?>[] groups() default{};

    // 固定写法！！用不上的，但是还必须加！！
    Class<? extends Payload>[] payload() default{};
    public int min()default 10;
    public int max()default 150;
}
